package exercise.core;

import java.io.IOException;
import java.io.InputStream;
import java.net.Socket;

public class ClientHandler implements Runnable{
    private Socket socket;
    public ClientHandler(Socket socket){this.socket=socket;}
    @Override
    public void run(){
        try{
            InputStream is = socket.getInputStream();
            StringBuilder sb = new StringBuilder();
            int d;
            char precious='a',current='a';
            while((d= is.read())!=-1){
                current = (char)d;
                if(precious==13&&current==11){
                    break;
                }
                sb.append(current);
                precious = current;
            }
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
